<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <script src="js/css.js"></script>
</head>

<body>
<div class="login_bg"></div>
<div class="login">
  <!--<div class="title"><i>紫色鹭</i>后台管理系统</div>-->
  <div class="login_box">
    <div class="title">欢迎登陆</div>
    <div class="box">
      <ul>
        <li class="border">
          <i class="icon_login"></i>
          <input type="text" placeholder="请输入用户名" v-model="username">
        </li>
        <li class="border">
          <i class="icon_password"></i>
          <input type="password" placeholder="请输入登录密码" v-model="password">
        </li>
        <li>
          <div class="submit" @click="login">登录</div>
        </li>
      </ul>
    </div>
  </div>
</div>


<script src="js/config.js"></script>

<script type="text/javascript">

  var app = new Vue({
    el: '.login',
    data: {
        username:'',
        password:''
    },
    methods: {
        login:function () {
            if(!this.username){
                alert("请输入用户名");
                return
            }
            if(!this.password){
                alert("请输入密码");
                return
            }

            get_ajax("/web/auth/login",{username:this.username,password:this.password},function (data) {
                localStorage.setItem("Token",data);
                location.href = "index.html";
            })
        }
    },

    beforeCreate: function () {

    },

  });


</script>

</body>

</html>